/*
 * 版权信息：北京汉方三陆零科技有限公司</br>
 * Copyright ©2014-2015. All rights reserved.  京ICP备15000045号
 */
package com.lin.strategy;

import com.lin.strategy.behavior.fly.FlyBehavior;
import com.lin.strategy.behavior.quack.QuackBehaivor;

/****************************************************************************
 * com.lin.strategy Duck.java Created on 2016年1月6日
 * @Author: linfenliang
 * @Description:
 * @Version: 1.0
 ***************************************************************************/
public abstract class Duck {

	private FlyBehavior flyBehavior;
	private QuackBehaivor quackBehavior;
	
	public abstract void display();
	public void swim(){
		System.out.println("a duck is swimming");
	}
	
	public void performQuack(){
		this.quackBehavior.quack();
	}
	public void performFly(){
		this.flyBehavior.fly();
	}
	public void setFlyBehavior(FlyBehavior flyBehavior) {
		this.flyBehavior = flyBehavior;
	}
	public void setQuackBehavior(QuackBehaivor quackBehavior) {
		this.quackBehavior = quackBehavior;
	}
}
